package com.utils;

import com.model.FrontUser;
import org.springframework.util.DigestUtils;

public class Md5Utils {

    public static String decodeFrontUser(FrontUser user) {
        return decodeFrontUser(user.getUsername(), user.getPassword());
    }

    public static String decodeFrontUser(String username, String password) {
        return Md5Utils.decode(username + " plus " + password);
    }

    public static String decode(String code) {
        return DigestUtils.md5DigestAsHex(code.getBytes());
    }
}
